package com.yonyou.cyxdms.sysAuth.service.controller.manage.log;


import com.yonyou.cyx.framework.controller.base.BaseController;
import com.yonyou.cyxdms.sysAuth.service.service.log.MenuOperateLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author maxingjian
 * @since 2019-10-21
 */
@Api(value = "菜单日志", tags = {"菜单日志"})
@RestController
@RequestMapping("/menuLog")
public class MenuOperateLogController extends BaseController {
    private final Logger logger = LoggerFactory.getLogger(MenuOperateLogController.class);

    @Autowired
    public MenuOperateLogService menuOperateLogService;

    /**
     * 记录登录菜单
     *
     * @param:
     * @return:
     * @auther: maxingjian
     * @since: 2019/10/21
     */
    @GetMapping("/recordLog")
    @ApiImplicitParams({@ApiImplicitParam(value = "用户id", name = "userId", required = true, dataType = "string",
            paramType = "header")})
    public void recordLog(@ApiParam(name = "menuId", value = "菜单Id", required = true) @RequestParam(value = "menuId") String menuId) {
        menuOperateLogService.recordLog(menuId);
    }
}